package com.qili.service.exam;

import com.qili.base.service.BaseService;
import com.qili.entity.exam.ExPaper;
import com.qili.entity.exam.ExQuestion;
import com.qili.entity.exam.ExTree;
import com.qili.entity.exam.dto.ExPaperDTO;
import com.qili.entity.exam.dto.ExQuestionDTO;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author zhangxiaopeng
 * @date 2021-05-08
 */
@Service
public interface ExPaperService extends BaseService<ExPaper, String> {
    /**
     * 树形根目录
     *
     * @param tree
     * @return
     */
    List<ExTree> selectTree(ExTree tree);

    /**
     * 查询第三级
     *
     * @param tree
     * @return
     */
    List<ExTree> selectTrees(ExTree tree);

    /**
     * 修改试题分类
     *
     * @param map
     * @return
     */
    int updateTree(Map map);

    List<ExQuestion> stList(String id);

    List<ExQuestion> stListByType(ExQuestionDTO exQuestionDTO);

    List<String> insertPaperSj(ExPaperDTO exPaperDTO);

    List<ExPaper> selectExQuestion(ExPaperDTO dto);

    List<ExPaper> selectExPaper(ExPaperDTO dto);

    List<ExPaper> selectRecycle(ExPaper dto);

    int deleteSjs(Map map);

    Integer refreshTotalScore(String paperId);

    int updateBatchPaperStatus(String[] ids);

    int deleteSt(Map map);

    int insertTree(Map map);

    Integer refreshTotalNum(String paperId);

    Map<String, Object> selectPaperQuCountById(String paperId);

    List<Map<String, Object>> selectRandomSt(ExPaperDTO exPaperDTO);

    int refreshQuestionSjCanUse(ExQuestion exQuestion, String[] quIds);

    int delFormRecycle(String paperId);

    int deleteFromRecycle(String[] ids);


    int hyAll(String[] ids);

    /**
     * 递归查出试题分类数据-【2021年11月15日13:29:50】
     * @param id
     * @param groupid
     * @return
     */
    List<ExTree> selectSubordinateTrees(String id, String groupid);

    /**
     * 批量删除
     * @param map
     */
    void deleteSjsN(Map<String, Object> map);

    /**
     * 回收站批量还原
     * @param id
     * @param type
     */
    void hyAllN(String id, String type);

    List<ExTree> selectTreesByType(ExTree tree, String type);
}


